/***********************************************************************************************************************************
 * Name:	CMD_PublishPOSReports.sql
 * Author:	Frank Figearo (frank@sqlnerd.me)
 * Summary:	Generates commands for RS.exe to publish POS reports to all base
 * POS servers. This script must be executed on the Central Management Server.
 */
SET IMPLICIT_TRANSACTIONS OFF; WHILE 1 < @@TRANCOUNT ROLLBACK;
USE [msdb];
GO
SELECT
	CommandLine= 'RS -i PublishPOSReports.rss -s ' + server_name + '/ReportServer'
  FROM dbo.sysmanagement_shared_registered_servers_internal
  WHERE server_group_id = 10
  ORDER BY server_name;
GO